package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.AlertRule;
import com.zzyl.vo.AlertRuleVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AlertRuleMapper {
    void create(AlertRule alertRule);

    Page<AlertRuleVo> getPage(String alertRuleName, String functionName, String productKey);

    List<AlertRule> selectAllRules();

    /**
     * 条件查询报警规则
     *
     * @param functionId 功能标识符
     * @param iotId      设备id
     * @param productKey 所属产品key
     * @return 报警规则列表
     */
    List<AlertRule> selectByFunctionId(@Param("functionId") String functionId, @Param("iotId") String iotId, @Param("productKey") String productKey);

    void deleteByPrimaryKey(Long id);

    AlertRuleVo read(Long id);

    void update( AlertRule alertRule);

    void updateStatus(Integer id, Integer status);
}
